home *** CD-ROM | disk | FTP | other *** search
/ Flybox Trout (Edition 1) / Flybox Trout (Edition 1).iso / Setup / Support / FlyBox.exe / FlyBox.dxr / 00004_FlyResultsMinor.ls < prev    next >
Encoding:
Text File  |  2002-04-15  |  1.2 KB  |  31 lines

  1. global DBPath
  2.  
  3. on exitFrame me
  4.   MinorID = getVariable(sprite(1), "MinorID")
  5.   db = DGOpenDatabase(DBPath & "FlyBox.mdb", 0, 0, ";PWD=StopLooking")
  6.   rs = DGCreateRecordset("SELECT FlyID, Picture, FlyName, Comments as Descript FROM Fly WHERE MinorID = " & MinorID & " ORDER BY FlyName", db)
  7.   a = 0
  8.   repeat while not DGRSisEOF(rs)
  9.     setVariable(sprite(1), "Result" & a & "_FlyID", DGRSGetFieldValue("FlyID", rs) & EMPTY)
  10.     setVariable(sprite(1), "Result" & a & "_Picture", DGRSGetFieldValue("Picture", rs))
  11.     setVariable(sprite(1), "Result" & a & "_FlyName", DGRSGetFieldValue("FlyName", rs))
  12.     setVariable(sprite(1), "Result" & a & "_Descript", DGRSGetFieldValue("Descript", rs))
  13.     DGRSmoveNext(rs)
  14.     a = a + 1
  15.   end repeat
  16.   Results = getVariable(sprite(1), "Results")
  17.   Results = Results.integer
  18.   setVariable(sprite(1), "Results", a & EMPTY)
  19.   repeat while a < Results
  20.     setVariable(sprite(1), "Result" & a & "_FlyID", EMPTY)
  21.     setVariable(sprite(1), "Result" & a & "_Picture", EMPTY)
  22.     setVariable(sprite(1), "Result" & a & "_FlyName", EMPTY)
  23.     setVariable(sprite(1), "Result" & a & "_Descript", EMPTY)
  24.     a = a + 1
  25.   end repeat
  26.   DGRSClose(rs)
  27.   DGClose(db)
  28.   sprite(1).goToFrame("Results")
  29.   go("Finished")
  30. end
  31.